home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group98c.txt / 000035_icon-group-sender _Wed Sep 16 16:47:20 1998.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id QAA10673
  4.     for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Wed, 16 Sep 1998 16:47:19 -0700 (MST)
  5. Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
  6.     id AA05641; Wed, 16 Sep 1998 16:46:51 -0700
  7. Message-Id: <4FD6422BE942D111908D00805F3158DF0757B5AF@RED-MSG-52>
  8. From: Todd Proebsting <toddpro@microsoft.com>
  9. To: icon-group@optima.CS.Arizona.EDU
  10. Subject: RE: Context Switching
  11. Date: Wed, 16 Sep 1998 13:16:15 -0700
  12. X-Mailer: Internet Mail Service (5.5.2232.9)
  13. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  14. Status: RO
  15.  
  16. The problem of implementing co-expressions is directly related to how the
  17. implementation handles generators.  If generators use stack allocation AND
  18. they leave activation records on the stack at a co-expression invocation,
  19. then separate stacks are necessary for co-expressions.  Otherwise, suspended
  20. activation records from different co-expressions could become interwoven,
  21. and that would spell disaster.
  22.  
  23. The current Icon interpreter uses recursion for some generators.  Because
  24. the interpreter is written in C, uses recursion, and leaves those
  25. activations on the stack at co-expression invocation, there is no getting
  26. around the need for separate stacks.  The recursive interpreter model is
  27. quite elegant---getting rid of it to support co-expressions would be a giant
  28. pain.
  29.  
  30. Jcon (http://www.cs.arizona.edu/icon/jcon/) does not use a recursive
  31. interpreter, but suspended procedures definitely live on the stack at
  32. co-expression invocations.  Therefore, it also relies on a context-switching
  33. mechanism (Java threads) to maintain multiple stacks.
  34.  
  35. If the underlying implementation language (e.g., C or Java) supports only
  36. stack allocation of activation records, then it would be necessary to make
  37. sure the stack is ALWAYS in the same configuration at co-expression
  38. activation to avoid the need for a context switch.  This would be very
  39. painful in compiled code.  In an interpreter it would be easier, but no fun.
  40.  
  41. Todd Proebsting
  42.